package com.ry.dvd.design.product.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.ry.core.base.controller.BaseController;
import com.ry.core.base.service.IBaseService;
import com.ry.dvd.design.product.model.Product;
import com.ry.dvd.design.product.service.ProductService;

/**
 * 产品控制层类
 */
@Controller
@Scope(value = "prototype")
public class ProductController extends BaseController<Product> {

	@Autowired
	private ProductService productService;

	@Override
	public IBaseService getEntityService() {
		return productService;
	}

	@RequestMapping
	public ModelAndView toGetProductList(HttpServletRequest request,
			HttpServletResponse response)throws Exception {
		request.setAttribute("proList", productService.getProductList());
		return view("list");
	}
}
